********************************************************************************
********************************************************************************
*********** Racial Resentment vs. Principled Conservatism: 1992 Data ***********
********************************************************************************
********************************************************************************

use "Clean Data, 1992"

********************************************************************************	
	
****
** Correlational analyses
****	

corrci ideo2 spending2
corrci ideo2 biggov2 

corrci ideo2 raceresentsum2
corrci spending2 raceresentsum2
corrci biggov2 raceresentsum2

****
** IRT-Logit DIF analyses
****

sum spending2 if conserv == 1 
gen dumspend = 0 if spending2 <= .6093505
replace dumspend = 1 if spending2 > .6093505

sum spending2
gen dumspend2 = 0 if spending2 <= .5419177
replace dumspend2 = 1 if spending2 > .5419177


sum biggov2 if conserv == 1
gen dumgov = 0 if spending2 <= .5042735
replace dumgov = 1 if spending2 > .5042735

sum biggov2 
gen dumgov2 = 0 if spending2 <= .3340054
replace dumgov2 = 1 if spending2 > .3340054


preserve
difdetect favors conditions deserve tryhard, ru(spend) ///
	ab(origirt) gr(dumspend)
keep caseid theta_spend
save "theta_spend92.dta", replace	
restore	
	
preserve	
difdetect favors conditions deserve tryhard, ru(conserv) ///
	ab(origirt) gr(conserv) 
keep caseid theta_conserv
save "theta_conserv92.dta", replace	
restore	
	
preserve	
difdetect favors conditions deserve tryhard, ru(gov) ///
	ab(origirt) gr(dumgov)
keep caseid theta_gov
save "theta_gov92.dta", replace	
restore	

merge 1:1 caseid using "theta_spend92.dta"
drop _merge
merge 1:1 caseid using "theta_conserv92.dta"
drop _merge
merge 1:1 caseid using "theta_gov92.dta"

********************************************************************************
	
*****
** MIMIC approach to DIF
** detection (results appear
** in supplemental appendix)
*****

* Spending attitudes
sem (RR -> favors conditions deserve tryhard) ///
	(dumspend -> RR)
estat mindices


gsem (RR -> conditions favors deserve tryhard, ologit) ///
	(dumspend -> RR favors, ologit)	

gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumspend -> RR conditions, ologit)
	
gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumspend -> RR deserve, ologit)

gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumspend -> RR tryhard, ologit)
	
	
gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumspend -> RR conditions deserve tryhard, ologit)	


* Big government attitudes
sem (RR -> favors conditions deserve tryhard) ///
	(dumgov -> RR)
estat mindices


gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumgov -> RR favors, ologit)	

gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumgov -> RR conditions, ologit)		

gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumgov -> RR deserve, ologit)	

gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumgov -> RR tryhard, ologit)


gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumgov -> RR conditions deserve tryhard, ologit)
	

* Self-identifications
sem (RR -> favors conditions deserve tryhard) ///
	(conserv -> RR)
estat mindices


gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(conserv -> RR, regress)

gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(conserv -> RR favors, ologit)
	
gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(conserv -> RR conditions, ologit)

gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(conserv -> RR deserve, ologit)

gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(conserv -> RR tryhard, ologit)




